package com.example.rbacmanage.controller.app;

import com.example.rbacmanage.common.Result;
import com.example.rbacmanage.entity.app.Photo;
import com.example.rbacmanage.service.app.PhotoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/app/photo")
public class AppPhotoController {
    @Autowired
    private PhotoService photoService;

    @GetMapping("/list")
    public Result page(Photo photo){
        return Result.success(photoService.getPage(photo));
    }

    @GetMapping("/{id}")
    public Result getInfo(@PathVariable Long id){
        return Result.success(photoService.getById(id));
    }


}
